import request from '@/utils/request'

export const getMedicalCardPage = (params) => {
  return request({
    url: '/admin/medical-card/page',
    method: 'get',
    params
  })
}
export const getMedicalCardPageData = (params) => {
  return request({
    url: '/admin/medical-card/page/data',
    method: 'get',
    params
  })
}

export const addMedicalCard = (data) => {
  return request({
    url: '/admin/medical-card',
    method: 'post',
    data
  })
}

export const updateMedicalCard = (data) => {
  return request({
    url: '/admin/medical-card',
    method: 'put',
    data
  })
}

export const deleteMedicalCard = (id) => {
  return request({
    url: `/admin/medical-card/${id}`,
    method: 'delete'
  })
}

export const getMedicalCardById = (id) => {
  return request({
    url: `/admin/medical-card/${id}`,
    method: 'get'
  })
}

export const changeMedicalCardStatus = (id, status) => {
  return request({
    url: `/admin/medical-card/status/${status}`,
    method: 'post',
    params: { id }
  })
}
export const getMedicalCardsByInsureId = (insureId) => {
  return request({
    url: `/admin/medical-card/insure/${insureId}`,
    method: 'get'
  })
}
